﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="MyClasses.aspx.cs" Inherits="MyClasses" %>

<%@ Register TagPrefix="uc" TagName="UpdateProgress" Src="~/UserControls/UpdateProgress.ascx" %>
<%@ Register TagPrefix="uc" TagName="ModalPopupMessage" Src="~/UserControls/ModalPopupMessage.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="Server">
    <uc:UpdateProgress ID="updateProgress" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <uc:ModalPopupMessage ID="ModalPopupMessage" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:MultiView ID="MultiViewMyClasses" runat="server">
        <asp:View ID="SetupMode" runat="server">
            <div style="width: 93%; margin-right: auto; margin-left: auto;">
                <asp:UpdatePanel ID="UpdatePanelSeupMode" runat="server">
                    <ContentTemplate>
                        <asp:Wizard ID="WizardMyClassesSetup" runat="server" ActiveStepIndex="0" CssClass="MinWidth"
                            BackColor="White" BorderColor="#666666" BorderWidth="1px" Font-Names="Verdana"
                            Font-Size="0.9em" DisplaySideBar="false" OnFinishButtonClick="WizardMyClassesSetup_Finish"
                            onnextbuttonclick="WizardMyClassesSetup_NextButtonClick">
                            <HeaderTemplate>
                                ILE My Class List Setup Wizard
                            </HeaderTemplate>
                            <StartNavigationTemplate>
                                <div style="padding: 10px;">
                                    <asp:Button ID="StartNextButton" runat="server" CommandName="MoveNext" Text="Start"
                                        Width="100" ToolTip="Click this button to start!" />
                                </div>
                            </StartNavigationTemplate>
                            <StepStyle Font-Size="1em" ForeColor="#000000" />
                            <NavigationButtonStyle ForeColor="Black" CssClass="fancyButton" />
                            <WizardSteps>
                                <asp:WizardStep ID="WizardStep1" Title="Welcome" runat="server">
                                    <div style="padding: 10px;">
                                        <h2>
                                            Welcome to ILE</h2>
                                        <div style="margin-left: 20px; font-size: medium; line-height: 150%;">
                                            ILE is a learning management system your class will be using. ILE has been 
                                            designed to assist your understanding of concepts related to working with 
                                            information.
                                        </div>
                                    </div>
                                </asp:WizardStep>
                                <asp:WizardStep ID="WizardStep2" Title="Setup" runat="server">
                                    <div style="padding: 10px;">
                                        <h2>
                                            Select your class(es)</h2>
                                        <div class="indent20">
                                            <asp:DropDownList ID="ddlistCourses" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlistCourses_SelectedIndexChanged"
                                                ToolTip="Choose your Course." />
                                            <asp:DropDownList ID="ddlistSections" runat="server" AutoPostBack="True" Enabled="False"
                                                OnSelectedIndexChanged="ddlistSections_SelectedIndexChanged">
                                                <asp:ListItem Selected="True" Value="0">--Sections--</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:Button ID="btnAddToMyClassList" runat="server" Visible="false" Text="Add" Enabled="false" OnClick="btnAddToMyClassList_Click" />
                                            <br />
                                            <hr />
                                            <br />
                                            <center>
                                                <asp:Label runat="server" ID="lblMsgMyClassList" />
                                            </center>
                                            <br />
                                            <h3 style="font-weight: bold;">
                                                My Class List</h3>
                                            <asp:ObjectDataSource ID="ObjectDataSourceMyClassList" runat="server" DeleteMethod="DeleteMyClass"
                                                OldValuesParameterFormatString="{0}" SelectMethod="GetMyClassesByUserID" TypeName="MyClassesBLL">
                                                <DeleteParameters>
                                                    <asp:Parameter Name="courseID" Type="Int32" />
                                                    <asp:Parameter Name="sectionNumber" Type="Int32" />
                                                    <asp:Parameter Name="userID" Type="Int32" />
                                                </DeleteParameters>
                                                <SelectParameters>
                                                    <asp:SessionParameter Name="userID" SessionField="UserID" Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:GridView ID="GridViewMyClassList" runat="server" AutoGenerateColumns="False"
                                                CellPadding="4" DataKeyNames="CourseID,SectionNumber,UserID" CssClass="MinWidth"
                                                DataSourceID="ObjectDataSourceMyClassList" ForeColor="#333333" GridLines="None"
                                                OnRowDeleted="GridViewMyClassList_RowDeleted">
                                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                                <Columns>
                                                    <asp:CommandField ShowDeleteButton="True" />
                                                    <asp:BoundField DataField="Title" HeaderText="Course Title" SortExpression="SortOrder">
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="SectionNumber" HeaderText="Sect. #" SortExpression="SectionNumber"
                                                        ReadOnly="True" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="ClassTime" HeaderText="Class Time" SortExpression="ClassTime"
                                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </asp:BoundField>
                                                </Columns>
                                                <EditRowStyle BackColor="#999999" />
                                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                            </asp:GridView>
                                            <div style="min-width: 530px; text-align: center;">
                                                <asp:Label ID="lblNoClass" runat="server"></asp:Label>
                                            </div>
                                        </div>
                                    </div>
                                </asp:WizardStep>
                                <asp:WizardStep ID="WizardStep3" Title="About You" runat="server">
                                    <div style="padding: 10px;">
                                        <h2>
                                            Your Information</h2>
                                        <div style="padding-left: 20px; line-height: 140%;">
                                            <table>
                                                <tr>
                                                    <td class="tableLeftHeader">
                                                        First Name :
                                                    </td>
                                                    <td class="tableItem">
                                                        <asp:Label ID="lblFirstName" runat="server" />
                                                        <asp:TextBox ID="txtFirstName" runat="server" MaxLength="50" Visible="false" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="tableLeftHeader">
                                                        Last Name :
                                                    </td>
                                                    <td class="tableItem">
                                                        <asp:Label ID="lblLastName" runat="server" />
                                                        <asp:TextBox ID="txtLastName" runat="server" MaxLength="50" Visible="false" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="tableLeftHeader">
                                                        Email :
                                                    </td>
                                                    <td class="tableItem">
                                                        <asp:TextBox ID="txtEmail" runat="server" MaxLength="100" Height="20px" 
                                                            Width="200px" />
                                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                                            ErrorMessage="Not a vaild email address." ControlToValidate="txtEmail" 
                                                            Display="Dynamic" 
                                                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="AboutYou"></asp:RegularExpressionValidator>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Required." ControlToValidate="txtEmail" ValidationGroup="AboutYou"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="tableLeftHeader">
                                                        Year :
                                                    </td>
                                                    <td class="tableItem">
                                                        <asp:DropDownList ID="ddlistYear" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlistYear_SelecectedIndexChanged">
                                                            <asp:ListItem Value="-1">-- Please Choose --</asp:ListItem>
                                                            <asp:ListItem Value="1">Freshman</asp:ListItem>
                                                            <asp:ListItem Value="2">Sophomore</asp:ListItem>
                                                            <asp:ListItem Value="3">Junior</asp:ListItem>
                                                            <asp:ListItem Value="4">Senior</asp:ListItem>
                                                            <asp:ListItem Value="5">Graduate Student</asp:ListItem>
                                                            <asp:ListItem Value="0">Other</asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </asp:WizardStep>
                                <%--Get Rid of It--
                                <asp:WizardStep ID="WizardStep4" Title="ILE Tips" runat="server">
                                    <div style="padding: 10px;">
                                        <h2>
                                            Tips for using ILE
                                        </h2>
                                    </div>
                                </asp:WizardStep>
                                --%>
 <%--                               <asp:WizardStep ID="WizardStep4" runat="server" StepType="Finish" Title="Finish">
                                    <div style="padding: 10px;">
                                        <h2>
                                            Finished</h2>
                                        <div style="margin-left: 20px;">
                                            Setup Complete.
                                        </div>
                                    </div>
                                </asp:WizardStep>--%>
                            </WizardSteps>
                            <SideBarButtonStyle BackColor="#EEEEEE" Font-Names="Verdana" ForeColor="#555555" />
                            <SideBarStyle BackColor="#EEEEEE" Font-Size="1.2em" VerticalAlign="Middle" HorizontalAlign="Center"
                                Width="100" BorderStyle="Solid" BorderColor="#666666" BorderWidth="1px" />
                            <HeaderStyle BackColor="#EEEEEE" BorderColor="#666666" BorderStyle="Solid" BorderWidth="1px"
                                Font-Bold="True" Font-Size="1.7em" ForeColor="Black" HorizontalAlign="Center"
                                Height="30" />
                        </asp:Wizard>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </asp:View>
        <asp:View ID="NormalMode" runat="server">
            <asp:UpdatePanel ID="UpdatePanelNormalMode" runat="server">
                <ContentTemplate>
                    <h1>
                        My Classes</h1>
                    <div style="width: 93%; text-align: right; font-size: 9pt; margin-top: -9px; margin-bottom: 5px;
                        margin-right: auto; margin-left: auto;">
                        <a href="MyClasses.aspx?mode=setup">Edit My Classes List</a>
                    </div>
                    <asp:Repeater ID="rptrMyClassList" runat="server" OnItemDataBound="rptrMyClassList_ItemDataBound">
                        <HeaderTemplate>
                            <table class="table" style="width: 93%; margin-left: 20px;">
                                <tr>
                                    <td class="tableTopHeader" style="width: 15px; height: 30px;">
                                    </td>
                                    <td class="tableTopHeader" style="width: 65%;">
                                        Course
                                    </td>
                                    <td class="tableTopHeader" style="width: 28%;">
                                        Section
                                    </td>
                                    <td class="tableTopHeader" style="text-align: center;">
                                        <%
                                            try
                                            {
                                                if (Session["AccountType"].ToString() == "Instructor")
                                                {
                                                    Response.Write("Cmd");
                                                }
                                            }
                                            catch
                                            {
                                                FormsAuthentication.SignOut();
                                                // *SteveMsg
                                                string _msg = "Your Session Information has ended. You are logged out to prevent errors.";
                                                ModalPopupMessage.ShowModalPopup_Redirect("ILE Message", _msg, 2, "Default.aspx");
                                                return;
                                            }
                                        %>
                                    </td>
                                </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr style="background-color: #EEEEEE;">
                                <td class="tableItem">
                                </td>
                                <td class="tableItem" style="height: 30px; vertical-align: middle;">
                                    <div style="margin-left: 10px; font-weight: bold; font-size: 11pt;">
                                        <asp:HyperLink ID="lnkCourseTitle" runat="server" />
                                    </div>
                                </td>
                                <td class="tableItem" style="text-align: center;">
                                    <asp:Label ID="lblSection" runat="server" />
                                </td>
                                <td class="tableItem" style="text-align: center;">
                                    <asp:LinkButton ID="lnkbtnInstructor" runat="server" Visible="false">Instructor</asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <td class="tableItem" colspan="4" style="text-align: left; height: 25px;">
                                    <div style="margin-left: 40px;">
                                        <asp:Label ID="lblAssignment" runat="server" Text="" />
                                    </div>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr style="background-color: #EEEEEE;">
                                <td class="tableItem">
                                </td>
                                <td class="tableItem" style="height: 30px; vertical-align: middle;">
                                    <div style="margin-left: 10px; font-weight: bold; font-size: 11pt;">
                                        <asp:HyperLink ID="lnkCourseTitle" runat="server" />
                                    </div>
                                </td>
                                <td class="tableItem" style="text-align: center;">
                                    <asp:Label ID="lblSection" runat="server" />
                                </td>
                                <td class="tableItem" style="text-align: center;">
                                    <asp:LinkButton ID="lnkbtnInstructor" runat="server" Visible="false">Instructor</asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <td class="tableItem" colspan="4" style="text-align: left; height: 25px;">
                                    <div style="margin-left: 40px;">
                                        <asp:Label ID="lblAssignment" runat="server" Text="" />
                                    </div>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </ContentTemplate>
            </asp:UpdatePanel>
        </asp:View>
    </asp:MultiView>
</asp:Content>
